﻿//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//    Crolengi, this program (a part of program) is gameengine based on C++\Directx
//    Copyright (C) 2008 Pashinin Anton Alekseevich (Crol)
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//    (INCLUDING NEGLIGENCE OR OTHERWISE) 
//    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
//    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//    Contacts: 
//    Mail: crolengi@gmail.com
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


#include "..\\StdAfx.h"

#ifndef character_included
#define character_included

class physWorld;

//#include "..\\..\\shared\\basePhysCharacter.h"
// инклуды библиотек физикса
#include "..//physx//NxPhysics.h"
#include "..//physx//cooking.h"
#include "..//physx/nxUtilities.h"
#include "..//physx//Stream.h"
#include "..//physx//SamplesVRDSettings.h"
#include "..//physx//Controller.h"
#include "..//physx//CharacterControllerManager.h"
#include "..//physx//Stream.h"
#include "..//physx//NxPhysics.h"
#include "..//physx//cooking.h"
#include "..//physx//NxPhysicsSDK.h"
#include "..//physx//NxPMap.h"
#include "..//physx//PhysXLoader.h"


//#include "charController.h"


 enum GameGroup
    {
        GROUP_COLLIDABLE_NON_PUSHABLE,
		GROUP_NON_COLLIDABLE,        
        GROUP_COLLIDABLE_PUSHABLE,
    };

#define COLLIDABLE_MASK	(1<<GROUP_COLLIDABLE_NON_PUSHABLE) | (1<<GROUP_COLLIDABLE_PUSHABLE)

class character //: public basePhysCharacter
{
	public:
	NxController* con;	// указатель на контроллер
	NxScene* g_pScene;   // указатель на "мир".

	NxControllerManager* CCMgr;

	float vec[4];

	// Controller globals
   bool bFixedStep;
   bool bMotion;
   NxVec3 gCharacterPos;
   NxVec3 gCharacterVec;
   NxF32 gCharacterSpeed;



	void update(float dt);
	void SetPosition(float x, float y, float z);
	void GetPosition(float* vec3);
	void GetPosition(NxExtendedVec3* vec3);
	bool createCapsule(float r, float h);

	void SetVector(float* vec3);	
	void SetVector(NxVec3 vector);
	void GetVector(float* vec3);
	void AddVector(NxVec3 vector);	


	character(NxControllerManager* c,NxScene* s){
		CCMgr = c;

	    g_pScene = s;
		createCapsule(50,100);


		 bFixedStep = false;
    bMotion = false;

    gCharacterVec = NxVec3(1,0,0);
    gCharacterSpeed = 5;
	
	}
	character(){};

};

/// класс для обнаружения столкновений между character и объектами мира



#endif